package thread.producer;

public class Consumer extends Thread{
    private WareHouse house;
    public Consumer(WareHouse house){
        this.house = house;
    }

    @Override
    public void run() {
        while (true){
            house.get();
            System.out.println("消费者拿走了一个产品");
            try {
                Thread.sleep(300);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
